<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<div id="app">
    <button onclick="aa()">aaaaaaaaaa</button>
</div>

<script>
    function aa() {
        alert(window.phone)
        if(window.phone){
            var mobile = encodeURIComponent(window.phone.obtainPhone())
            alert(mobile)
        };
    }
</script>
</html>